<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<script type="text/javascript">
		// 第一题
		function sum (a,b,c,d,e) {
			var a = [a,b,c,d,e];
			var j=a[0]+a[1]+a[2]+a[3]+a[4];
			return j;
		}
		document.write(sum(1,8,19,0,2)+'<br>');


		// 第二题
		function shuzu (a) {
			var sum = 0;
			for (var i = 0;i<a.length;i++) {
				 sum+= a[i];
			}
			return sum;
		}
		document.write(shuzu([1,2,3,4,5]));



	</script>
</body>
</html>